/*
 * FormFillerInstance.h
 *
 *  Created on: 27/01/2009
 *      Author: desadoc
 */

#ifndef FORMFILLERINSTANCE_H_
#define FORMFILLERINSTANCE_H_

#include <QWidget>
#include <QVector>
#include <QScrollArea>

#include "FormFillerRegister.h"

class FormFillerInstance : public QWidget
{

	Q_OBJECT

public:

	FormFillerInstance(QWidget* parent, const QString& filename, QScrollArea* s);

	bool isNew(void){return isNewV;}

	void load(void);
	void loadTalf(const QString& talf);

	void save(void);
	void saveAs(const QString& filename);
	bool close(void);
	void selectReg(unsigned int index);

	int numberOfRegisters();
	void addRegister();
	void remove();

private:

	void select(void);

	QString filename;
	QString talf;
	bool isNewV;
	bool isModified;
	unsigned int pos;
	unsigned int size;
	FormFillerRegister sample;
	QVector<FormFillerRegister*> regs;
	QVBoxLayout* layout;
	QScrollArea* scroll;
};


#endif /* FORMFILLERINSTANCE_H_ */
